<?php
if ($this->session->userdata('logged_in') == TRUE) {
    $this->load->view('view_login_success');
}
?>
<?php $this->load->view('view_pageheader'); ?>
<style type="text/css">
    .textRight {
        float: right;
    }
</style>
<label class="content_linkBack"><a onClick='window.history.go(-1)'>< Back</a></label>
<label class="content_this">| EDIT PERSON</label>

<?php echo form_open('con_users/Editperson'); ?>
<?php foreach ($data1 as $show) { ?>
    <table border="0" style="margin: auto;">
        <tr>
            <td><label class="textRight">ID : </label></td>
            <td><input type="text" name="personid" disabled="disabled" value="<?php echo $show->person_id; ?>" /></td>
        </tr>
        <tr>
            <td><label class="textRight">NAME :</label></td>
            <td><input type="text" name="fname" size="20" value="<?php echo $show->name; ?>" />*</td>
        </tr>
        <tr>
            <td><label class="textRight">SURNAME :</label></td>
            <td><input type="text" name="sname" size="20" value="<?php echo $show->surname; ?>" />*</td>
        </tr>
        <tr>
            <td><label class="textRight">USERNAME :</label></td>
            <td><input type="text" name="username" size="20" value="<?php echo $show->username; ?>" />*</td>
        </tr>
        <tr>
            <td><label class="textRight">PASSWORD :</label></td>
            <td><input type="text" name="password" size="20" value="<?php echo $show->password; ?>" />*</td>
        </tr>
        <tr>
            <td><label class="textRight">EMAIL :</label></td>
            <td><input type="text" name="email" size="20" value="<?php echo $show->email; ?>" />*</td>
        </tr>
        <tr>
            <td rowspan="3"><label class="textRight">Group :</label></td>
        </tr>
        <?php foreach ($qry_group as $row) { ?>
            <tr>
                <td>                    
                    <?php
                    foreach ($qry_chkgroup as $rows) {
                        if (($rows->gperson_id) == ($row->gperson_id)) {
                            echo '<input type="checkbox" name="gperson_id[]" id="gperson_id" checked="checked" value="' . $row->gperson_id . '" />' . $row->gperson_name . '';
                            continue 2;
                        } else {
                            continue 1;
                        }
                    }
                    echo '<input type="checkbox" name="gperson_id[]" id="gperson_id" value="' . $row->gperson_id . '" />' . $row->gperson_name . '';
                    ?>
                </td>
            </tr>
        <?php } ?>
        <tr>
            <td><label class="textRight">Active :</label></td>
            <td>
                <label>
                    <select name="active" id="active">
                        <option value="1">Yes</option>
                        <option value="0">No</option>
                    </select>
                </label>
            </td>
        </tr>
        <tr>
            <td colspan="2" style="text-align: center;">
                <input type="submit" value="Submit" />&nbsp;<input type="reset" value="Cancel" />
            </td>
        </tr>
    </table>
<?php } ?>
<?php echo form_close(); ?>

<?php $this->load->view('view_pagefooter'); ?>
   